<?php 

require_once("../Watajax.class.php");

mysql_connect('localhost','watajax','watajax');
mysql_select_db('watajax');

$w = new WatajaxSql();
$w->columns = array(
	"id" => array("name" => "#", "sort_type" => "numeric", "hide" => true),
	"firstname" => array("name" => "First name"),
	"lastname" => array("name" => "Last name"),
	"group" => array("name" => "grupp", "filter" => "select"),
	"email" => array("name" => "E-mail adress", "transform" => "<a href=\"mailto:!email\">!email</a>"),
	"tools" => array("name" => "#", "virtual" => true, "transform" => "<a href=\"?edit=!id\">edit</a>")	
);
$w->addClass("green", "group", 'return ($column_data == "group1");');
$w->addClass("green", "group", 'return (test($column_data));');
$w->run();

function test($column_data) {
    if ($column_data == "group3") {
        return true;
    } else {
        return false;
    }
}

?>